<?php

namespace App\Http\Requests\Administrator;


class PlayerBetFlowRequest extends Request
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {

        switch ($this->method()) {
            // CREATE
            case 'PATCH':
            case 'POST':
                return [
                    'username' => 'nullable|string',
                    'site_username' => 'nullable|string',
                    'game_code' => 'nullable|string',
                    'main_game_plat_code' => 'nullable|string',
                    'game_flow_code' => 'nullable|string',
                    'bet_amount' => 'nullable|numeric',
                    'available_bet_amount' => 'nullable|numeric',
                    'company_payout_amount' => 'nullable|numeric',
                    'company_win_amount' => 'nullable|numeric',
                    'plat_type' => 'nullable|string',
                    'lobby_type' => 'nullable|string',
                    'bet_flow_available' => 'nullable|integer',
                    'status' => 'nullable|integer',
                    'bet_time' => 'nullable|date',
                    'pull_at' => 'nullable|date',
                    'created_at' => 'nullable|date',
                    'updated_at' => 'nullable|date',
                ];
            case 'PUT':

            case 'GET':
                {
                    return [
                        'bet_start_date' => 'nullable|date',
                        'bet_end_date' => 'nullable|date',
                        'username' => 'nullable|exists:inf_site_players,username',
                        'site_username' => 'nullable|exists:conf_sites,username',
                        'main_game_plat_code' => 'nullable|exists:def_main_game_plats,main_game_plat_code',
                        'game_flow_code' => 'nullable|exists:log_player_bet_flow,game_flow_code',
                    ];
                }
            case 'DELETE':
            default:
                {
                    return [];
                };
        }
    }
}
